/**
 * 
 */
package cz.cvut.fit.bugtrac.gexf;

import java.util.HashSet;
import java.util.Set;

/**
 * @author Jarec
 * 
 */
public class MyEdge {

	private String id;
	private Set<MyNode> nodes;

	public MyEdge(String id, MyNode first, MyNode second) {
		this.id = id;
		this.nodes = new HashSet<MyNode>();
		nodes.add(first);
		nodes.add(second);
	}

	public String getId() {
		return id;
	}

	public Set<MyNode> getNodes() {
		return nodes;
	}

	@Override
	public int hashCode() {
		return Integer.valueOf(id.trim());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("MyEdge [");
		if (id != null) {
			builder.append("id=").append(id).append(", ");
		}
		if (nodes != null) {
			builder.append("nodes=").append(nodes);
		}
		builder.append("]");
		return builder.toString();
	}

}